# 编写频道表相关业务
from rest_framework.viewsets import ModelViewSet
from rest_framework.permissions import IsAdminUser
from rest_framework.response import Response
from apps.goods.models import GoodsChannel
from apps.meiduo_admin.serializers.channels import GoodsChannelSerialzier
from apps.meiduo_admin.utils import NumPage

class ChannelsView(ModelViewSet):
    # 指定序列化器
    serializer_class = GoodsChannelSerialzier
    # 指定查询集
    queryset = GoodsChannel.objects.all()
    # 指定权限
    permission_classes = [IsAdminUser]
    # 指定分页
    pagination_class = NumPage
